<head>
<title>Hail Satan!</title>
<meta http-equiv="X-UA-Compatible" content="chrome=1" />

<meta content="width=device-width; initial-scale=1.0;  maximum-scale=1.0; user-scalable=0;" name="viewport" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<script>
var loaded = false;

var cards = new Array();

function flip_card(k) {
	var self = cards[k];
	if (self['ready']) {
		self['flipped'] = ! self['flipped'];
		if (self['flipped']) {
			self['card'].src = self['face'].src;
		} else {
			self['card'].src = self['back'].src;
		}
	}
}

function load_card(k) {
	var self = cards[k];
	self['card'] = document.getElementById(k);
	self['face'] = new Image();
	self['face'].src = 'c/c' +  self['k'] + '.png';
	self['back'] = new Image();
	self['back'].src = 'b/b' +  self['k'] + '.png';
	self['card'].src = self['back'].src;
	self['flipped'] = false;
	self['ready'] = true;
}

function load_cards() {
	var c = new Array();
	var i, j;

	for (i = 1; i <= 8; ++i) { for (j = 1; j <= 9; ++j) {
		c.push(i + '' + j);
	} }
	
	var k = 'past present future adversary forbidden'.split(' ');
	for (i = 0; i < k.length; ++i) {
		var a = new Array();
		a.push('card' + k[i]); a.push('bcard' + k[i]);
		for (j = 0; j < a.length; ++j) {
			var n = Math.floor(c.length * Math.random());
			cards[a[j]] = new Array();
			cards[a[j]]['k'] = c[n];
			c[n] = c[0]; c.shift();
		}
	}

	for (i in cards) {
		load_card(i);
	}

}

function init() {
	load_cards();
	loaded = true;
}

function cardclick(self) {
	flip_card(self);
}
</script>
</head>
<body bgcolor="#ff0000" onload="init()">
<table cellpadding="0" cellspacing="0" width="100%" height="100%" border="0" valign="middle"><tr><td align="center" valign="middle"><!--
--><a href="javascript:cardclick('bcardpresent')"><img id="bcardpresent" src="black.png" width="120" height="120" /></a><!--
--><br /><!--
--><a href="javascript:cardclick('bcardpast')"><img id="bcardpast" src="black.png" width="120" height="120" /></a><!--
--><a href="javascript:cardclick('cardpast')"><img id="cardpast" src="black.png" width="120" height="120" /></a><!--
--><a href="javascript:cardclick('cardpresent')"><img id="cardpresent" src="black.png" width="120" height="120" /></a><!--
--><a href="javascript:cardclick('cardfuture')"><img id="cardfuture" src="black.png" width="120" height="120" /></a><!--
--><a href="javascript:cardclick('bcardfuture')"><img id="bcardfuture" src="black.png" width="120" height="120" /></a><!--
--><br /><!--
--><a href="javascript:cardclick('bcardadversary')"><img id="bcardadversary" src="black.png" width="120" height="120" /></a><!--
--><a href="javascript:cardclick('cardadversary')"><img id="cardadversary" src="black.png" width="120" height="120" /></a><!--
--><a href="javascript:cardclick('cardforbidden')"><img id="cardforbidden" src="black.png" width="120" height="120" /></a><!--
--><a href="javascript:cardclick('bcardforbidden')"><img id="bcardforbidden" src="black.png" width="120" height="120" /></a><!--
--><br />.<!--
--></td></tr></table>
</body>
